<nav class="navbar navbar-expand-md fixed-top custom-navbar">
  <a class="navbar-brand" routerLink="/">AllParts</a>
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault"
    aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>

  <div class="collapse navbar-collapse" id="navbarsExampleDefault">
    <ul class="navbar-nav mr-auto">
      <li class="nav-item active">
        <a class="nav-link" routerLink="/">Home</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" routerLink="/products">Products</a>
      </li>
      <ng-template #notLoggedIn>
        <li class="nav-item">
          <a class="nav-link" routerLink="/login">Login</a>
        </li>
      </ng-template>
      <li *ngIf = "auth.user$ | async as user; else notLoggedIn" ngbDropdown class="nav-item dropdown">
        <a ngbDropdownToggle class="nav-link dropdown-toggle" id="dropdown01" data-toggle="dropdown" aria-haspopup="true"
          aria-expanded="false">{{ user.displayName }}</a>
        <div ngbDropdownMenu class="dropdown-menu" aria-labelledby="dropdown01">
          <a class="dropdown-item" (click) = "logout()">Logout</a>
        </div>
      </li>
    </ul>
  </div>
</nav>
